
if __name__ == '__main__':
	n = int(input())
	a = [0 for i in range(310)]
	a[0] = 0
	a[1] = 1
	for i in range(2,310):
		a[i] = 34 * a[i-1] - a[i-2] + 2
	print(a[n])
